﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.Data;
using System.Data.SqlClient;

namespace capaNegocios
{
    public class clsConexion
    {
        //private String usuarioBD;
        //private String contraseñaBD;
        private String cadenaConexion;

        public SqlConnection AbrirConexion()
        {
            SqlConnection objConexion = new SqlConnection();

            //usuarioBD = "";
            //contraseñaBD = "";

            //cadenaConexion = "Data Source = 172.30.105.29; Initial Catalog =BD_VENTLIB; UID=" + usuarioBD + "; PWD=" + contraseñaBD + "; Trusted_Connection=False;";
            cadenaConexion = "Data Source=AMYS-PC;Initial Catalog=SWE_SistemaWedEducactivo;Integrated Security=SSPI;";

            try
            {
                objConexion.ConnectionString = cadenaConexion;
                objConexion.Open();

                return objConexion;
            }
            catch (SqlException ex)
            {
                objConexion = null;
                return objConexion;

                throw ex;
            }
        }
    }
}
